package com.study.mike.common.enums;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

/**
 * @author KangHui
 * @Date 2023/3/24 9:47
 */
@Getter
public enum BookStatusEnum {
    OFF(0, "禁用"),
    ON(1, "启用");
    @EnumValue
    private final Integer status;
    @JsonValue
    private final String value;

    BookStatusEnum(Integer status, String value) {
        this.status = status;
        this.value = value;
    }

//    public static BookStatusEnum getEnum(String value) {
//        if (ObjectUtil.equal(BookStatusEnum.ON.value, value)) {
//            return BookStatusEnum.ON;
//        } else {
//            return BookStatusEnum.OFF;
//        }
//    }
}
